@page
@model IdentityServerTemplate.Pages.Ciba.AllModel

<div class="container-fluid mb-4 px-0">
    <header class="pb-3 mb-4 border-bottom">
        <h1 class=" fw-bold">
            <i class="bi bi-door-open text-brand"></i>
            CIBA (Pending Backchannel Login Requests)
        </h1>
        <span class="text-muted">
            Lists active back-channel login requests—showing parameters like client ID, login hint, scopes and status—so you can track and debug asynchronous user authentication flows.
        </span>
    </header>
</div>

@if (Model.Logins.Any())
{
    <table class="table table-bordered table-striped table-sm">
        <thead>
            <tr>
                <th>Id</th>
                <th>Client Id</th>
                <th>Binding Message</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            @foreach (var login in Model.Logins)
            {
                <tr>
                    <td>@login.InternalId</td>
                    <td>@login.Client.ClientId</td>
                    <td>@login.BindingMessage</td>
                    <td>
                        <a asp-page="Consent" asp-route-id="@login.InternalId" class="btn btn-primary">Process</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
else
{
    <div class="row">
        <div class="col">
            <div class="alert alert-light text-center">
                No Pending Login Requests.
            </div>
        </div>
    </div>
}
